package com.dlc.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dlc.shop.bean.dto.StockPointSkuDTO;
import com.dlc.shop.bean.model.StockPointSku;
import com.dlc.shop.bean.vo.StockPointSkuVO;
import com.dlc.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 *
 * @author FrozenWatermelon
 * @date 2023-11-09 18:00:43
 */
public interface StockPointSkuMapper extends BaseMapper<StockPointSku> {

    /**
     * 获取列表
     * @param pageDTO
     * @return 列表
     */
    IPage<StockPointSku> list(PageParam pageDTO);

    /**
     * 获取库存点skuVO集合
     * @param stockPointSkuDTO 库存点skuDTO
     * @return 库存点skuVO集合
     */
    List<StockPointSkuVO> listStockPointSku(@Param("stockPointSkuDTO") StockPointSkuDTO stockPointSkuDTO);

    /**
     * 根据id获取
     *
     * @param stockPointSkuId id
     * @return
     */
    StockPointSku getByStockPointSkuId(@Param("stockPointSkuId") Long stockPointSkuId);

    /**
     * 保存
     * @param stockPointSku
     */
    void save(@Param("stockPointSku") StockPointSku stockPointSku);

    /**
     * 更新
     * @param stockPointSku
     */
    void update(@Param("stockPointSku") StockPointSku stockPointSku);

    /**
     * 根据id删除
     * @param stockPointSkuId
     */
    void deleteById(@Param("stockPointSkuId") Long stockPointSkuId);

    /**
     * 根据id集合删除
     * @param stockPointSkuIds 关联id集合
     */
    void deleteByIds(@Param("stockPointSkuIds") List<Long> stockPointSkuIds);

    /**
     * 根据商品id删除
     * @param prodId
     */
    void deleteBySpuId(@Param("prodId") Long prodId);

    /**
     * 批量保存
     * @param stockPointSkuList
     */
    void batchSave(@Param("stockPointSkuList") List<StockPointSkuDTO> stockPointSkuList);

    /**
     * 批量删除
     * @param stockPointSkuIdList
     */
    void batchDeleteByStockPointSkuIdList(@Param("stockPointSkuIdList") List<Long> stockPointSkuIdList);

    /**
     * 根据skuid获取所有的库存点关联仓库信息
     * @param skuIds
     * @return
     */
    List<StockPointSkuVO> listBySkuIds(@Param("skuIds") List<Long> skuIds);

    /**
     * 获取库存关联点数量
     * @param stockPointId
     * @return
     */
    List<StockPointSkuVO> listByPointId(@Param("stockPointId") Long stockPointId);

    /**
     * 根据skuid和库存点id删除数据
     * @param skuId
     * @param stockPointId
     */
    void removeBySkuIdAndPointId(@Param("skuId") Long skuId, @Param("stockPointId") Long stockPointId);

    /**
     * 获取指定sku的仓库列表
     * @param skuIds
     * @return
     */
    List<StockPointSkuVO> listPointBySkuIds(@Param("skuIds") List<Long> skuIds);

    /**
     * 根据库存点id修改库存模式
     * @param stockPointId
     * @param stockMode
     */
    void updateStockMode(@Param("stockPointId")Long stockPointId, @Param("stockMode")Integer stockMode);
}
